﻿@using StackExchange.Profiling
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title</title>
    <style type="text/css">
        body {
          min-height: 1000px;
          padding-top: 70px;
        }
    </style>
    @Html.GenerateAdminStyles()
    <script type="text/javascript">
        var siteRoot = '@Url.Content("~/")';
    </script>
    <!-- Bootstrap from CDN -->
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
    @RenderSection("preScripts", false)
    <script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
    @Html.GenerateAdminScripts()
    
</head>
<body>
    @Html.Action("DatabaseNotice", "Admin", new { Area = "Admin" })
    <!-- Fixed navbar -->
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span
                        class="icon-bar"></span><span class="icon-bar"></span>
                </button>
                @Html.ActionLink("sBlog.Net", "Index", "Home", new { Area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    @if (Request.IsAuthenticated)
                    {
                        <li>@Html.AdminLink("Dashboard", "dashboard", "AdminIndex")</li>
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img alt="Ad" src="@Url.Content("~/Content/Images/add.png")" class="adminImage"/>
                            Add <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li>@Html.AdminLink("Post", "post", "AdminPostsAdd")</li>
                                @if (User.IsInRole("SuperAdmin"))
                                {
                                    <li>@Html.AdminLink("Page", "page", "AdminPagesAdd")</li>
                                }
                            </ul>
                        </li>
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img alt="Manage" src="@Url.Content("~/Content/Images/manage.png")" class="adminImage"/>
                            Manage <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li>@Html.AdminLink("Posts", "manageposts", "AdminPosts")</li>
                                @if (User.IsInRole("SuperAdmin"))
                                {
                                    <li>@Html.AdminLink("Pages", "managepages", "AdminPages")</li>
                                }
                                @if (User.IsInRole("SuperAdmin") || User.IsInRole("Admin"))
                                {
                                    <li>@Html.AdminLink("Categories", "categories", "AdminCategories")</li>
                                    <li>@Html.AdminLink("Tags", "tags", "AdminTags")</li>
                                }
                                <li>@Html.AdminLink("Comments", "comments", "AdminComments")</li>
                                @if (User.IsInRole("SuperAdmin"))
                                {
                                    <li>@Html.AdminLink("Uploads", "uploads", "AdminUploads")</li>
                                }
                                @if (User.IsInRole("SuperAdmin") || User.IsInRole("Admin"))
                                {
                                    <li class="divider"></li>
                                    <li>@Html.AdminLink("User Posts", "manage_posts", "AdminPostManagement")</li>
                                    <li>@Html.AdminLink("User Comments", "manage_comments", "AdminCommentManagement")</li>
                                }
                            </ul>
                        </li>
                        if (User.IsInRole("SuperAdmin") || User.IsInRole("Admin"))
                        {
                             <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                                      <img alt="Settings" src="@Url.Content("~/Content/Images/settings.png")" class="adminImage"/>
                                                      Settings <span class="caret"></span></a>
                                 <ul class="dropdown-menu" role="menu">
                                     @if (User.IsInRole("SuperAdmin"))
                                     {
                                         <li>@Html.AdminLink("Blog Settings", "blog_settings", "AdminSettings")</li>
                                         <li>@Html.AdminLink("Social Sharing", "sharing", "AdminSocialSharingOptions")</li>
                                     }
                                     @if (User.IsInRole("SuperAdmin") || User.IsInRole("Admin"))
                                     {
                                         <li>@Html.AdminLink("Syntax Highlighter", "highlighter", "AdminSyntaxHighlighterOptions")</li>
                                         <li class="divider"></li>
                                         <li>@Html.AdminLink("Manage Users", "user_management", "AdminUserManagement")</li>
                                         <li>@Html.AdminLink("Create User", "create_user", "Add", "Account")</li>
                                     }
                                 </ul>
                             </li>
                        }
                    }
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    @if (Request.IsAuthenticated)
                    {
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img alt="Options" src="@Url.Content("~/Content/Images/options.png")" class="adminImage"/>
                            Options <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                                <li>@Html.AdminLink("My Profile", "profile", "AdminUpdateProfile")</li>
                                <li>@Html.AdminLink("Logoff", "logoff", "Logoff")</li>
                            </ul>
                        </li>
                    }
                    else
                    {
                        <li>@Html.AdminLink("Logon", "login", "Logon")</li>
                    }
                </ul>
            </div>
            <!--/.nav-collapse -->
        </div>
    </div>
    <div class="container">
        @RenderBody()
    </div>
    <!-- /container -->
    @MiniProfiler.RenderIncludes()
</body>
</html>
